import 'package:flutter/material.dart';

import 'const.dart';

class PubPage extends StatefulWidget {
  const PubPage({super.key});

  @override
  State<PubPage> createState() => _PubPageState();
}

class _PubPageState extends State<PubPage> {
  double textFont = 16;

  @override
  Widget build(BuildContext context) {
    mScreenHeight = MediaQuery.of(context).size.width;
    mScreenWidth = MediaQuery.of(context).size.height;
    return Dialog(
      backgroundColor: Colors.white,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.zero,
      ),
      child: Container(
        width: mScreenWidth * 0.9,
        // height: mScreenHeight * 0.7,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Container(
              padding: EdgeInsets.only(left: 20),
              height: 70,
              color: Colors.blue,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  const Text(
                    '18:21 Jan 24,2022',
                    style: TextStyle(color: Colors.white),
                  ),
                  IconButton(
                    key: ValueKey('clearButton'),
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                    icon: const Icon(
                      Icons.clear,
                      color: Colors.white,
                      size: 16,
                    ),
                  )
                ],
              ),
            ),
            Text('XXXXXXXXX'),
            Text(
              'XXXXXXXXXX',
              style: TextStyle(fontSize: textFont),
            ),
            Align(
              alignment: Alignment.bottomRight,
              child: Container(
                width: 100,
                height: 30,
                color: Colors.blue,
                child: Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 15),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      GestureDetector(
                        onTap: () {
                          setState(() {
                            textFont--;
                          });
                        },
                        child: Container(
                          width: 20,
                          height: 20,
                          child: Center(child: Text('-')),
                          decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(10)),
                        ),
                      ),
                      Text('Aa'),
                      GestureDetector(
                        onTap: () {
                          setState(() {
                            textFont++;
                          });
                        },
                        child: Container(
                          key: ValueKey('add'),
                          width: 20,
                          height: 20,
                          child: Center(child: Text('+')),
                          decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(10)),
                        ),
                      )
                    ],
                  ),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
